<?php

namespace App\Kuafu\Customer\Validate;

use App\Kuafu\Base\Validate\BaseValidate;
use App\Kuafu\Customer\Enum\PlatformCodeEnum;

class LoginValidate extends BaseValidate
{
    public static function loginCheck($code, $platformId)
    {
        $rules    = [
            'code'       => 'required',
            'platformId' => 'required|integer|in:' . implode(',', array_keys(PlatformCodeEnum::PLATFORM_CODE_TEXT)),
        ];
        $messages = [];
        $data     = ['code' => $code, 'platformId' => $platformId];
        return self::validateCheck($data, $rules, $messages);
    }
}
